<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <!-- INTERFACE -->
    <cc:interface>
        <cc:attribute name="bill" />
        <cc:attribute name="billItems" />
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>
        <h:outputStylesheet library="css" name="pharmacyA4.css"/>
        <div class="posbill noBorder summeryBorder" >

            <div class="institutionName">
                <h:outputLabel value="#{cc.attrs.bill.creater.department.printingName}"/>
            </div>
            
            <div >

                <h4 style="color: #000000; text-align: center " >
                    <h:outputLabel value="Payment Voucher" style="text-decoration: underline;"/>
                </h4>


                <div>
                    <h:outputLabel value="Payee : " style="text-align: right!important;"/>
                    <h:outputLabel value="#{cc.attrs.bill.toInstitution.name}"/>
                    <h:outputLabel value="Date :"  style="position: relative; left: 70%;" />
                    <h:outputLabel value="#{cc.attrs.bill.createdAt}"  style="position: relative; left: 70%;" >
                        <f:convertDateTime pattern="dd MM yyyy hh mm a"/>
                    </h:outputLabel>
                    
                </div>
                
                <div>
                    
                    <p:dataTable value="#{cc.attrs.billItems}" var="bi" sortBy="#{bi.referenceBill.invoiceNumber}">
                        
                        <p:column headerText="Po Approve">
                            <p:outputLabel value="#{bi.referenceBill.referenceBill.createdAt}" style="text-align: center;">
                            <f:convertDateTime pattern="dd/mm/yyyy hh:mm a"/>                                
                            </p:outputLabel>
                        </p:column>                   

                        
                        <p:column headerText="Grn Date">
                            <p:outputLabel value="#{bi.referenceBill.createdAt}" style="text-align: center;">
                            <f:convertDateTime pattern="dd/mm/yyyy hh:mm a"/>
                                
                            </p:outputLabel>
                        </p:column>
                        
                        <p:column headerText="Grn Number" >
                            <p:outputLabel value="#{bi.referenceBill.insId}" style="text-align: center;"/>
                        </p:column>
                        
                        
                        
                        <p:column headerText="Invoice Number" >
                            <p:outputLabel value="#{bi.referenceBill.invoiceNumber}" style="text-align: center;"/>
                        </p:column>
                        
                        <p:column headerText="Amount">
                            <p:outputLabel value="#{0-bi.referenceBill.netTotal}" style="text-align: right;">
                            <f:convertNumber pattern="#,##0.00" />
                            </p:outputLabel>
                        </p:column>
                        
                    </p:dataTable>
                    
                </div>
                
                <div>
                    <br></br>
                    <h:outputLabel value="Prepared By :" /> 
                    <h:outputLabel value="#{cc.attrs.bill.creater.webUserPerson.nameWithTitle}" style="text-align: right!important;text-decoration: underline; text-decoration-style: dotted;"/>
                    <br></br>                
                    <br></br>         
                    <h:outputLabel value="Approved By :"/>
                    <h:outputLabel value="#{cc.attrs.bill.referenceBill.creater.webUserPerson.nameWithTitle}"/>
                    <br></br>                                      
                    <br></br>
                    <h:outputLabel value="Authorized By :"/>
                    <h:outputLabel value="................................................................"/>
                    <br></br>
                    <br></br>

                    <h:outputLabel value="Cheque No :"/>
                    <h:outputLabel value="...................................................................."/>
                    <h:outputLabel value="Amount : Rs. #{0-cc.attrs.bill.netTotal} " style="position: absolute; left: 70%;"/>
                    <br></br>
                    <br></br>                    
                    <h:outputLabel value="Received with thanks sum of Rupees  .................................................................................................................................................. Ruhunu Pharmaceuticals &amp; Services (Pvt) Ltd : "/>
                    <br></br>

                    <!--                    <div >-->

                    <!--<h:outputLabel value="Date :"  style="position: relative; left: 70%;" />-->
                    <!--                        <br/>-->
                    <!--                        <h:outputLabel value="Amount : Rs. " style="font-weight: bold;position: relative; left: 70%;"/>-->
                    <!--                        <h:outputLabel value="#{0-cc.attrs.bill.netTotal}" style="font-weight: bold;position: relative; left: 71%;">-->
                    <!--<f:convertNumber pattern="#,##0.00" />-->
                    <!--                        </h:outputLabel>-->
                    <!--                        <br/>-->
                    <div>
                        <h:outputLabel value="Stamp : " style="position: relative; left: 70%; "/>
                        <div style="position: relative; border: 1px black dashed!important;height: 60px;width: 50px; left: 75%;">
                        </div>
                        <!--                        <h:outputLabel value="Stamp " style="position: relative; left: 70%;"/>-->
                        <!--                        <br></br>-->
                        <h:outputLabel value="Date : " style="position: relative; left: 70%;"/>
                        <br></br>
                        <h:outputLabel value="Name : " style="position: relative; left: 70%;"/>
                    </div>
                </div>

            </div>
        </div>
    </cc:implementation>
</html>
